package util;

import com.registry.RegStringValue;
import com.registry.RegistryKey;
import com.registry.ValueType;


public class RegistryUtil {
	public static void registryApple(String path) {
		RegistryKey r = new RegistryKey(RegistryKey.getRootKeyForIndex(RegistryKey.HKEY_LOCAL_MACHINE_INDEX), "Software\\Apple Inc.\\Apple Application Suppor");
		if (!r.exists()) {
			System.out.println("开始注册Apple Application Support");
			r.create();
			RegStringValue v = (RegStringValue) r.newValue("InstallDir", ValueType.REG_SZ);
			if(path == null || "".equals(path)) {
				path = "C:/Program Files/Safari/Apple Application Support";
			}
			//v.setValue("G:/Program Files/Safari/Apple Application Support");
			v.setValue(path);
		}

	}
}
